package com.bjsxt;

import java.util.Comparator;

public class StudentComparator02 implements Comparator<Student02> {

    @Override
    public int compare(Student02 o1, Student02 o2) {
        if(o1.getAge()>o2.getAge()){
            return 1;
        }
        if(o1.getAge()==o2.getAge()){
            return o1.getName().compareTo(o2.getName());
        }
        return -1;
    }
}
